﻿@model TeamSearchResultViewModel

@{ var routeValues = new { area = "TeamArea", id = Model.TeamVersion.Pk };}

@if (Model.IsVisible)
{
    <div class="searchitem">
        <div>
            <a class="search1" href="@Url.Action("Index", "Details", routeValues)">@Model.TeamVersion.TeamName</a>
                
            @if (Model.TeamVersion.ActiveTo == _DateTime.HighDate && Model.TeamVersion.IsApproved)
            {
                <span class="k-icon k-i-clock" title="This is the current version of the team."></span>
            }

            @if (!Model.TeamVersion.IsApproved)
            {
                <span class="k-icon k-i-note" title="Awaiting approval."></span>
            }
        </div>

        @if (Model.TeamVersion.HomeVenueGuid != null)
        {
            <div>
                <a class="subsearch" href="@Url.Action("Index", "Details", new { area = "VenueArea", id = Model.TeamVersion.HomeVenueGuid })">@Model.TeamVersion.HomeVenue.VenueName</a>
            </div>    
        }

        <div><a class="subsearch" href="@Url.Action("Index", "Details", new { area = "CountryArea", id = Model.TeamVersion.CountryGuid })">@Model.TeamVersion.Country.CountryName</a></div>

        <div>
            @if (Model.IsDeleteVisible) { @Html.Partial("Links/_DeleteLink", routeValues); }

            @if (Model.IsConfirmApprovalVisible) { @Html.Partial("Links/_ConfirmApprovalLink", routeValues); }
        </div>
    </div>
}

